<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>作业</title>
  <link rel="stylesheet" href="./css/index.css">
</head>

<body>
  <!-- 数据渲染并打印内容 -->
  <div id="box1">
    <ul>
      <!-- 传递参数 -->
      <li v-for="(value,index) in arr" :key="index" @click="btn(index)">
        <img :src="value.url" alt="">
        <p class="text">{{value.text}}</p>
        <p class="price">{{value.price}}</p>
      </li>
    </ul>
  </div>

  <!-- 双向绑定，实现数据新曾-->
  <div id="box2">
    <input type="text" v-model="inputVal">
    <!-- {{inputVal}} -->
    <p v-for="(value,index) in old">{{value}}</p>
    <button @click="btn">新增</button>
  </div>

  <script src="./js/vue.js"></script>
  <script src="./js/index.js"></script>
</body>

</html>